package stock.commons;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

import com.mysql.jdbc.Connection;

public abstract class FileReader {

	public static void processFile(File file, LineProcessor processor, Connection conn) {
		try {
			Scanner scanner = new Scanner(file);
			while (scanner.hasNextLine()) {
				processor.processLine(scanner.nextLine(), conn);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}